﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using com.ClickCricket.dal;

/// <summary>
/// Summary description for CountryService
/// </summary>
/// 
namespace com.ClickCricket.bll
{
    public class CountryService
    {
        private static CountryService instance;

        public static CountryService Instance 
        {
            get
            {
                if (instance == null)
                {
                    instance = new CountryService();
                }
                return instance;
            }
        }

        private readonly ICountryProvider countryProvider;

        public CountryService(ICountryProvider countryProvider)
        {
            this.countryProvider = countryProvider;
        }

        public CountryService()
            : this(new CountryLinqProvider())
        {
         
        }


        public Country getCountry(int CountryId)
        {
            return countryProvider.getCountry(CountryId);
        }

        public Country getRandomCountry()
        {
            return countryProvider.getRandomCountry();
        }

        internal List<Country> getCountries()
        {
            return countryProvider.getCountries();
        }


        public List<Country> getCountry()
        {
            return countryProvider.getCountry();
        }
    }
}
